﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RoleList.aspx.cs" Inherits="HQWeb.SysManage.RoleManage.RoleList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <%-- <link href="../../Styles/Site.css" rel="Stylesheet" type="text/css" />--%>
    <link href="../../Styles/GridViewStyle.css" rel="Stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        function Edit(obj) {
            location = "RoleEdit.aspx?sigin=edit&id=" + obj;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table align="center" width="98%">
            <tr>
                <td class="title">
                    角色管理
                </td>
            </tr>
            <tr>
                <td>
                    <input id="btnAdd" type="button" value="新增角色" onclick="javascript:location='RoleEdit.aspx?sigin=add'" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="GridViewStyle"
                        PageSize="25" Width="100%" AllowPaging="True" CellPadding="4" CellSpacing="1"
                        GridLines="None" AllowSorting="false" EmptyDataText="没有数据记录！！" DataKeyNames="ROLE_ID"
                        OnRowEditing="GridView1_RowEditing" OnRowDeleting="GridView1_RowDeleting" OnRowDataBound="GridView1_RowDataBound"
                        OnPageIndexChanging="GridView1_PageIndexChanging">
                        <Columns>
                            <asp:BoundField DataField="ROLE_ID" HeaderText="编号" SortExpression="ID" />
                            <asp:BoundField DataField="ROLE_NAME" HeaderText="角色名 " SortExpression="ROLENAME" />
                            <asp:TemplateField HeaderText="功能">
                                <ItemTemplate>
                                    <asp:LinkButton ID="EditButton" Text="增加人员" CommandName="Edit" runat="server" />
                                    <a onclick="Edit('<%#Eval("ROLE_ID")%>')" style=" cursor:pointer">编辑</a> &nbsp;
                                    <asp:LinkButton ID="DelButton" Text="删除" CommandName="Delete" runat="server" OnClientClick="return confirm('确认要删除此行信息吗？')" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerTemplate>
                            <table width="100%">
                                <tr>
                                    <td style="text-align: center">
                                        第<asp:Label ID="lblPageIndex" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />页
                                        共<asp:Label ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount  %>' />页
                                        <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False" CommandArgument="First"
                                            CommandName="Page" Text="首页" ForeColor="White" />
                                        <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False" CommandArgument="Prev"
                                            CommandName="Page" Text="上一页" ForeColor="White" />
                                        <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False" CommandArgument="Next"
                                            CommandName="Page" Text="下一页" ForeColor="White" />
                                        <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False" CommandArgument="Last"
                                            CommandName="Page" Text="尾页" ForeColor="White" />
                                        <asp:TextBox ID="txtNewPageIndex" runat="server" Width="28px" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />
                                        <asp:LinkButton ID="btnGo" runat="server" CausesValidation="False" CommandArgument="-1"
                                            CommandName="Page" Text="GO" ForeColor="White" /><!-- here set the CommandArgument of the Go Button to '-1' as the flag -->
                                    </td>
                                </tr>
                            </table>
                        </PagerTemplate>
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                        <PagerStyle CssClass="GridViewPagerStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
